libxl: don't execute hotplug scripts if device is on a driver domain
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 3 May 2013 11:23:02 +0000 (13:23 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 8 May 2013 11:06:55 +0000 (12:06 +0100)
Prevent hotplug script execution from libxl if device is on a
different domain.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_device.c

index b1fc4efe03f53508a16d43eb5bdf8c223d322007..bc86648af80244d5144d508539bb243747370d6a 100644 (file)
@@ -903,6 +903,13 @@ static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev)
     int hotplug;
     pid_t pid;
 
+    /*
+     * If device is attached from a driver domain don't try to execute
+     * hotplug scripts
+     */
+    if (aodev->dev->backend_domid != LIBXL_TOOLSTACK_DOMID)
+        goto out;
+
     /* Check if we have to execute hotplug scripts for this device
      * and return the necessary args/env vars for execution */
     hotplug = libxl__get_hotplug_script_info(gc, aodev->dev, &args, &env,